
local LIBDEMO = _G.libdemo
-- 请最优先执行，因为这时候引擎还没有chdir，目录还在engine下。
local function InitWorkDir()
	-- local conf = dofile("config.lua")
	assert(LIBDEMO.set_cwd("./scripts"))
end

local function LoadCommonFile()
	local filelist = {
		"base/traceback.lua",
		"base/extend.lua",
		"base/import.lua",
		"base/class.lua",
		"base/ldb.lua",
		"base/log.lua",
		"base/macros.lua",
	}
	for _, file in ipairs(filelist) do
		assert(not dofile(file), file)
	end
end

local function LoadBaseFile()
					Import("base/coreobj.lua")
	STRUCT        = Import("base/struct.lua")
	ALL_SCENE	  = Import("scene/allscene.lua")
	CORE_SCENE    = Import("scene/corescene.lua")
	SCENE_OBJ		= Import("scene/sceneobj.lua")
	SCENE_USER		= Import("scene/sceneuser.lua")
	AOI_TEST	  = Import("scene/aoi_test.lua")
end

function ServerBoot()
	InitWorkDir()
	LoadCommonFile()
	LoadBaseFile()
end